using System;

namespace GGameFramework.Core.Pool
{
    /// <summary>
    /// 动态引用类型对象池
    /// </summary>
    public class DynamicReferencePool<T> : ReferenceObjectPool<T> where T : IReference//ReferencePoolable
    {
        public int MaxSize { get; private set; }

        public DynamicReferencePool(
            Func<T> createFunc,
            Action<T> onSpawn = null,
            Action<T> onRecycle = null,
            Action<T> onDestroy = null,
            int initialCapacity = 5,
            int maxSize = 100) 
            : base(createFunc, onSpawn, onRecycle, onDestroy, new DynamicPoolingStrategy(maxSize), initialCapacity)
        {
            MaxSize = maxSize;
        }
    }
}